import React from 'react';
import {
    Button,
    Text,
    View,
    Image,
    StyleSheet,
    Dimensions,
    StatusBar,
    ActivityIndicator,
    FlatList,
    ScrollView,
    RefreshControl,
    Animated,
    TouchableHighlight,
    DeviceEventEmitter,
    Alert, Modal,
    TouchableOpacity
} from 'react-native';
import Swiper from 'react-native-swiper';
import { MarqueeHorizontal, MarqueeVertical } from 'react-native-marquee-ab';
import Styles from './Styles';
import Football from "../../utils/Football";
import app from '../../../app.json';
import Ugame from '../../../Ugame';
import Httpc from "../../utils/Httpc";
import REQUEST from "../../../REQUEST";

const { width, height } = Dimensions.get('window')
class LogoTitle extends React.Component {
    render() {
        return (
            <TouchableOpacity onPress={() => this.on_go_betgame()}>
                <Text>111</Text>
            </TouchableOpacity>
        );
    }
}
export default class BetSuccess extends React.Component {
    constructor(props) {
        super(props);
        this.state = {

        };
        this.game_model = null;
    }
    static navigationOptions = ({ navigation }) => {
        return {
            headerLeft: <View>
                <TouchableOpacity onPress={navigation.getParam('on_go_betgame')}>
                    <Image resizeMode="cover" style={{marginLeft:15}} source={require('../../image/abc_ic_ab_back_mtrl_am_alpha.png')} />
                </TouchableOpacity>
            </View>,
            headerStyle: {
                backgroundColor: '#d0162e',
                paddingTop: 18,
            },
            headerTintColor: '#fff',
            headerTitleStyle: {
                //fontWeight: 'bold',
            },
        }
    };
    componentWillMount() {
        //组件将要被加载到视图之前调用

    }
    componentDidMount() {
        this.game_model = this.props.navigation.getParam("game_model");
        this.props.navigation.setParams({ on_go_betgame: this.on_go_betgame });

    }
    componentWillUnmount() {

    }
    on_go_betgame = () => {
        this.props.navigation.navigate(this.game_model);
    }
    on_go_betlists = () => {
        this.props.navigation.navigate('GameOrder');
    }

    render() {
        return (
            <View style={Styles.container}>
                <StatusBar translucent={true} backgroundColor="transparent" />
                <View style={{ width: width, height: height - 300, flexDirection: 'column', justifyContent: 'center', alignItems: 'center' }}>
                    <Image resizeMode="cover" source={require('../../image/js_img_icon_success.png')} />
                    <Text style={{ color: '#666666', fontSize: 14, padding: 10 }}>投注成功</Text>
                </View>
                <View style={{ width: width, height: 200, flexDirection: 'row', justifyContent: 'space-around', alignItems: 'center' }}>
                    <TouchableOpacity onPress={() => this.on_go_betgame()}>
                        <Text style={{ width: (width - 90) / 2, height: 45, backgroundColor: '#d0162e', color: '#ffffff', borderRadius: 5, textAlign: 'center', lineHeight: 45 }}>继续投注</Text>
                    </TouchableOpacity>
                    <TouchableOpacity onPress={() => this.on_go_betlists()}>
                        <Text style={{ width: (width - 90) / 2, height: 45, borderColor: '#d0162e', color: '#d0162e', borderWidth: 1, borderRadius: 5, textAlign: 'center', lineHeight: 45 }}>查看订单</Text>
                    </TouchableOpacity>
                </View>
            </View>
        )
    }



}
